package com.ctgu.fcftsystem.service;

import com.ctgu.fcftsystem.dao.SecuritiesDao;
import com.ctgu.fcftsystem.pojo.Securities;
import com.ctgu.fcftsystem.pojo.Sercurity_trade;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class SecuritiesServiceImpl implements SecuritiesService{
    @Autowired
    private SecuritiesDao securitiesDao;

    @Override
    public List<Securities> findByPaging(int pageCount, int pageSize) {
        return securitiesDao.findByPaging(pageCount, pageSize);
    }

    /**
     * 添加证券用户
     * @param securities
     * @return
     */
    @Override
    public int addSecurities(Securities securities) {
        return  securitiesDao.addSecurities(securities);
    }

    /**
     * 根据持有人、证券公司、证券类型、起始时间和截止时间进行多重条件查询
     * @param securitiesOwner
     * @param securitiesCompany
     * @param securitierType
     * @param starTime
     * @param endTime
     * @return
     */
    @Override
    public List<Securities> searchSecuritiesUser(String securitiesOwner, String securitiesCompany, String securitierType, String starTime, String endTime) {
        return securitiesDao.searchSecuritiesUser(securitiesOwner, securitiesCompany,securitierType
                , starTime, endTime);
    }

    /**
     * 根据id删除证券用户信息
     * @param id
     * @return
     */
    @Override
    public int deleteSecuritiesUsrById(int id) {
        return securitiesDao.deleteSecuritiesUsrById(id);
    }

    /**
     * 维护证券用户信息
     * @param securities
     * @return
     */
    @Override
    public int updateSecuritiesUsrById(Securities securities) {
        return securitiesDao.updateSecuritiesUsrById(securities);
    }
}
